package com.bweab.controll.userstbcontrol.en;

import com.bweab.service.api.UsersTbServiceInterface;
import com.bweab.service.api.en.UserTbEnServiceInterface;
import com.bweab.service.impl.en.UsersTbEnServiceInterfaceImpl;
import com.bweab.util.JSONResult;
import com.bweab.util.PageList;
import com.bweab.util.WebUtil;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet("/adminQueryUserInfoLike")
public class AdminQueryUserInfoByLike extends HttpServlet {
    //创建服务
    UserTbEnServiceInterface userTbEnService=new UsersTbEnServiceInterfaceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        //获取参数
        String queryC = req.getParameter("condition");
        //当前页面
        int page = Integer.parseInt(req.getParameter("page"));
        //页面大小
        int pageSize= Integer.parseInt(req.getParameter("pageSize"));
        System.out.println(queryC);
        //调用服务  获取数据
        PageList pageList = userTbEnService.queryUserInfoByLike(queryC,page,pageSize);
        //发送数据

        WebUtil.writeJson(resp,pageList);
    }
}
